<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2022/3/9
  Time: 16:41
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>头部</title>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/statics/css/style22.css"/>
    <!--[if lt IE 9]>
    <![endif]-->
    <script src="${pageContext.request.contextPath}/statics/js/jquery.mCustomScrollbar.concat.min.js"></script>
    <script src="${pageContext.request.contextPath}/statics/js/jquery.js"></script>
    <script src="${pageContext.request.contextPath}/statics/js/html5.js"></script>
    <script src="${pageContext.request.contextPath}/statics/js/jquery.mCustomScrollbar.concat.min.js"></script>
</head>
<body>
<!--header-->
<header style="margin-top: -15px">
    <h1><img src="${pageContext.request.contextPath}/statics/img/admin_logo.png"/></h1>
    <ul class="rt_nav">
        <li><a href="${pageContext.request.contextPath}/bookStore/index" target="_blank" class="website_icon">商城首页</a></li>
        <li><a href="#" class="set_icon">账号设置</a></li>
        <li><a href="${pageContext.request.contextPath}/user/removeSession" class="quit_icon">安全退出</a></li>
    </ul>

    <script>

        window.onload = function () {
            var btn01 = document.getElementById("btn01");
            var btn02 = document.getElementById("btn02");
            btn01.onclick = function () {
                if (${pageInfo.pageNum >= pageInfo.pages}){
                    var ssr = document.getElementById("ssr");
                    ssr.innerHTML = "最后一页了熙哥";
                    var time = setInterval(function () {
                        ssr.innerHTML = " ";
                        clearInterval(time);
                    },2000);
                    btn01.href = ""
                }
                return;
            }
            btn02.onclick = function () {
                if(${pageInfo.isFirstPage}) {
                    var ssr = document.getElementById("ssr");
                    ssr.innerHTML = "第一页了熙哥";
                    var time = setInterval(function () {
                        ssr.innerHTML = " ";
                        clearInterval(time);
                    },2000);
                    btn02.href = "";
                }
                return;
            }
        }

    </script>
</header>
<!--aside nav-->
<!--aside nav-->
<aside class="lt_aside_nav content mCustomScrollbar">
    <ul>
        <li>
            <dl>
                <dt id="spgl">商品管理</dt>
                <dd><a href="${pageContext.request.contextPath}/book/allBook" <c:if test="${sessionScope.key== 'allbook'}">class="active"</c:if> onclick="allbook()">商品列表</a></dd>
                <dd><a href="${pageContext.request.contextPath}/book/toAddBook" <c:if test="${sessionScope.key== 'addbook'}">class="active"</c:if> onclick="addbook()">添加商品</a></dd>
            </dl>
        </li>
        <li>
            <dl>
                <dt>订单信息</dt>
                <dd><a href="${pageContext.request.contextPath}/orderList/queryAllOrder" <c:if test="${sessionScope.key== 'orderlist'}">class="active"</c:if> onclick="orderlist()">订单列表</a></dd>
            </dl>
        </li>
        <li>
            <dl>
                <dt>会员管理</dt>
                <dd><a href="${pageContext.request.contextPath}/user/alluser" <c:if test="${sessionScope.key== 'alluser'}">class="active"</c:if> onclick="alluser()">会员列表示</a></dd>
                <dd><a href="${pageContext.request.contextPath}/user/toaddUser" <c:if test="${sessionScope.key== 'adduser'}">class="active"</c:if> onclick="adduser">添加会员</a></dd>
            </dl>
        </li>
        <li>
            <dl>
                <dt>评论管理</dt>
                <dd><a href="${pageContext.request.contextPath}/book/queryAllComment" <c:if test="${sessionScope.key== 'allcomments'}">class="active"</c:if> onclick="allcomments()">评论列表</a></dd>
            </dl>
        </li>
        <li>
            <dl>
                <dt>配送与支付设置</dt>
                <dd><a href="express_list.html">配送方式</a></dd>
                <dd><a href="pay_list.html">支付方式</a></dd>
            </dl>
        </li>
        <li>
            <dl>
                <dt>在线统计</dt>
                <dd><a href="discharge_statistic.html">流量统计</a></dd>
                <dd><a href="sales_volume.html">销售额统计</a></dd>
            </dl>
        </li>
        <li>
            <p class="btm_infor">© xxx 版权所有</p>
        </li>
    </ul>
</aside>
<script>
    function allbook(){
        $.ajax({
            url:"${pageContext.request.contextPath}/book/addSession",
            type:"POST",
            data:{key:"allbook"}
        })
    }

    function addbook(){
        $.ajax({
            url:"${pageContext.request.contextPath}/book/addSession",
            type:"POST",
            data:{key:"addbook"}
        })
    }

    function alluser(){
        $.ajax({
            url:"${pageContext.request.contextPath}/book/addSession",
            type:"POST",
            data:{key:"alluser"}
        })
    }

    function adduser(){
        $.ajax({
            url:"${pageContext.request.contextPath}/book/addSession",
            type:"POST",
            data:{key:"adduser"}
        })
    }

    function orderlist(){
        $.ajax({
            url:"${pageContext.request.contextPath}/book/addSession",
            type:"POST",
            data:{key:"orderlist"}
        })
    }

    function allcomments(){
        $.ajax({
            url:"${pageContext.request.contextPath}/book/addSession",
            type:"POST",
            data:{key:"allcomments"}
        })
    }

</script>
</body>
</html>
